package com.zrwl.poscloud.xo.vo;

import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;;
import com.zrwl.poscloud.base.entity.UserEmployeeR;
import org.springframework.format.annotation.DateTimeFormat;;
import com.fasterxml.jackson.annotation.JsonFormat;;
import org.springframework.format.annotation.DateTimeFormat;;
import com.zrwl.poscloud.commons.vo.BaseVO;
import lombok.Data;

/**
 * 用户信息 VO类
 *
 * @author 刘思童 AutoGenerate
 * @date 2021-02-24
 */
@Data
public class UserVO extends BaseVO<UserVO> {
    private static final long serialVersionUID = 1L;
    private String userName;
    private String passWord;
    private String nickName;
    private int gender;
    private String avatar;
    private String email;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private String mobile;
    private String qqNumber;
    private String weChat;
    private String occupation;
    private String summary;
    private int loginCount;
    private String source;
    private String uuid;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginTime;
    private String lastLoginIp;
    private String ipSource;
    private int startEmailNotification;
    private String os;
    private String browser;
    private int userTag;
    private String photoUrl;
    private String categoryMenuUids;
    private UserEmployeeRVO userEmployeeRVO;

    public EmployeeVO getEmployeeInfo() {
        if (userEmployeeRVO == null||userEmployeeRVO.getEmployeeJsonData()==null||userEmployeeRVO.getEmployeeJsonData().equals("")) return null;
        return JSONObject.parseObject(userEmployeeRVO.getEmployeeJsonData(), EmployeeVO.class);
    }

}
